<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml" xmlns:shiro="http://www.w3.org/1999/xhtml">
<head>
    <head th:include="header :: header"></head>
    <title></title>
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">

            <a shiro:hasPermission="sys:user:save" class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>

            <a shiro.hasPermission="sys:user:update" class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>

            <a shiro.hasPermission="sys:user:delete" class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <div v-show="!showList" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal">
            <div class="form-group">
                <div class="col-sm-2 control-label">AppName</div>
                <div class="col-sm-10">
                    <input maxlength="30" type="text" class="form-control" v-model="jobgroup.appname" placeholder="AppName"/>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label">名称</div>
                <div class="col-sm-10">
                    <input maxlength="20" type="text" class="form-control" v-model="jobgroup.title" placeholder="名称"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">注册方式</div>
                <div class="col-sm-10">
                    <label class="radio-inline">
                        <input type="radio" name="addressType" @click="changeAddressType" value="0" v-model="jobgroup.addressType"/> 自动注册
                    </label>
                    <label class="radio-inline">
                        <input type="radio" name="addressType" @click="changeAddressType" value="1" v-model="jobgroup.addressType"/> 手动注册
                    </label>
                </div>
            </div>

            <div class="form-group" v-show="!autoRegister">
                <div class="col-sm-2 control-label">机器列表</div>
                <div class="col-sm-10">
                    <textarea maxlength="200" type="text" class="form-control" v-model="jobgroup.addressList" placeholder="手动填入IP，多个逗号分割"></textarea>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" id="btnSaveOrUpdate" data-loading-text="保存中..." @click="saveOrUpdate" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
            </div>
        </form>
    </div>
</div>

<script th:src="@{/statics/js/modules/xxljob/jobgroup.js}"></script>
</body>
</html>